<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/17/0017
 * Time: 17:27
 */

namespace app\sports_admin\controller;


use think\Request;
use app\sports_admin\model\AcademicStatus as AcademicStatusModel;
class AcademicStatus extends Base
{
    //学生答案首页
    public function index()
    {
        return view('index');
    }

    /**
     * 获取学生档案
     * @param $page 第几页
     * @param $rows 每页显示的条数
     * @param $sort 要排序的字段
     * @param $sortOrder 升序/降序
     * @param $searchName 要检索的字段
     */
    public function getAcademicStatusInfo()
    {
        $params = Request::instance()->only(['page','rows','sort','sortOrder','searchName']);
        $page = intval($params['page']) ? intval($params['page']) : 1;
        $rows = intval($params['rows']) ? intval($params['rows']) : 15;
        $sort = trim($params['sort']) ? trim($params['sort']) : 'id';
        $sortOrder = trim($params['sortOrder']) ? trim($params['sortOrder']) : 'asc';
        $searchName = trim($params['searchName']);
        return AcademicStatusModel::getAcademicStatusInfo($page,$rows,$sort,$sortOrder,$searchName);
    }
}